package easy.转小写;


import org.junit.Test;

public class Solution {
    public String toLowerCase(String str) {
        char[] low=str.toCharArray();
        StringBuilder stringBuffer=new StringBuilder();
        for (int i = 0; i < low.length; i++) {
            low[i]=Character.toLowerCase(low[i]);
            stringBuffer.append(low[i]);
        }
        return stringBuffer.toString();
    }
    public String toLowerCase2(String str) {
        char[] low=str.toCharArray();
        StringBuilder stringBuffer=new StringBuilder();
        for (int i = 0; i < low.length; i++) {
            if (low[i]>=65&&low[i]<=96)
                low[i]+=32;
            stringBuffer.append(low[i]);
        }
        return stringBuffer.toString();
    }
    @Test
    public void test1(){
        Solution solution=new Solution();
        System.out.println(solution.toLowerCase2("eLlO"));
        System.out.println(solution.toLowerCase("eLlO"));
//        int a='a';
//        System.out.printf("%d",a);
    }
}

